<div class="mainWarpArea">
    <div class="contentwarp">
     <div class="contentwarpMiddle">
     <div class="TechnologyTbl" style=" width:99%; background-color:#FFF;">
        <table border="0" cellspacing="2" cellpadding="2" width="100%">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td style="padding-bottom:6; padding-left:5;" colspan="2" >
     		<div style="min-height:300px;">
            <form name="vote_form" method="post">
                <?php 
                 /*$qry="select u.id id,university_name,count(vote) vote from university u left join ratting
					 r on r.search_id=u.id where(select count(vote) from ratting ) and  u.id='".$_GET['srch_id']."'
					 and r.active_status='1'";*/
					echo '<font color="#0488B9" style="margin-left:5px; padding-bottom:20px;"><b>Rate Your Universities</b></font>';
				/*$qry="SELECT count(search_id) search_id,u.id, university_name from  university u right 
					join ratting r on u.id=r.search_id  GROUP BY r.search_id";	 */
			  $qry="select id,university_name from  university where active_status='1'";
					
					$res = $base_obj->exec_query($qry);
					$data = $base_obj->fetch_row_all($res);	
					$count = count($data);
					if($count>0){
					for($i=0;$i<$count;$i++) 
					{
					if($_SESSION['user_id']!="")
					{
						$href_txt = 'href="javascript:;" onclick="vote('.$data[$i]['id'].');"';
					}	
					
					else {
					$href_txt = 'href="javascript:;"
					onclick="location.href=\'index.php?page=login\'"';
					}
		 $sql = "select `user_id`,count(vote) vote, `search_id` from ".$base_obj->RATTING." WHERE 
					search_id='".$data[$i][id]."' and active_status = '1' group by search_id order by search_id  asc ";
					$res_val = $base_obj->exec_query($sql);
				$data_val = $base_obj->fetch_row_all($res_val);	
				
				 $count_val = count($data_val);
				
				for($j=0;$j<$count_val;$j++) {
						echo '<table class="txtborder" style="margin:3px 3px 3px 3px; border:1px solid #E4E4E4; margin-left:130px; width:700px; padding:5px 5px 5px 5px;" border="0" width="98%" ><tr><td>'.$data[$i]['university_name'].'</td>
						
						<td align="right"><a  "'.$href_txt.'  style="cursor:pointer;">Rate
						Your University</a><br>(<span style="color:red">'.$data_val[$j]['vote'].'</span>)&nbsp;<span style="font-size:11px;color:#05506B">Peoples Like this</span>
						
						
						</td>
						</tr></table>';
				}
					}
					}
				else
				{
					echo '<p style="text-align:center;font-weight:bold;color:#0488B9;">No Active University\'s  Found  </p>';
				}  
					
                   ?>   
                   <input type="hidden" name="univ_id">
        <input type="hidden" name="process" id="process" value="vote_process"/>
        <input type="hidden" name="module" id="module" value="vote_module"/>
                   </form></div>               
            </td>
                                    
          </tr>
          <tr>
            <td background="s_images/20/mdh2.gif"><img src="s_images/spacer.gif" height="2" width="2"></td>
          </tr>
          
        </table></div>
      </div>
      <!-- End contentwarpMiddle -->
      <?php include("includes/right_content.php");?>
   
      
      <!-- End contentwarp -->
      <div style="clear:both;"></div>
    </div>
    <!-- End mainWarpArea -->
    <div style="clear:both;"></div>
  </div>
  <!-- End Wrapper -->
